package com.is.add.mapper;

import com.is.add.model.OrderBase;
import com.is.add.model.OrderRankingData;
import com.is.add.model.Orders;
import com.is.add.util.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 订单映射接口
 */
@Repository
public interface OrderMapper extends MyMapper<Orders> {
    /**针对 userorder_fixed 表查 */
    List<OrderBase> selectAllOrderBase(Map<String, String> map);

    /**针对 userorder 表查 */
    List<OrderBase> selectRecentlyOrderBase(Map<String, String> map);
    /**
     * 生产结算前修复异常订单
     * @param map       场馆id数组，起止时间
     * @return          修改的行数
     */
    int updateSettleFix(Map<String,Object> map);

    List<Orders> findSettleOrders(Map<String,Object> map);

    /**
     * 生成结算单后修改订单信息
     * @param map   时间，场馆id,结算状态，补贴状态
     * @return      修改的行数
     */
    int updateSettleOrders(Map<String,Object> map);

    OrderRankingData sumRecentlyOrderBase(Map<String, String> map);

    void refreshUserOrderFix(@Param("startTime") String startTime);
}
